//创建一个构造方法用来生成对应的礼品
/*
 参数说明：
 image:用来存储的图片对象
 kind:用来存储图片的类别
 * */
function Gift(image, kind) {
	this.image = image;
	if(kind == 1) {
		this.positionX = 0;
	}else if(kind == 2) {
		this.positionX = 39;
	}else if(kind == 3) {
		this.positionX = 78;
	}
	this.w = 39;
	this.h = 68;
	this.x = getRandom(0,myCanvas.width - 39);
	this.y = -this.h;
	this.speed = 2;
}
//定义函数用来绘制对应的礼品对象
Gift.prototype.draw = function() {
	ctx.drawImage(this.image,this.positionX,0,this.w,this.h,this.x,this.y,this.w,this.h);
}
//完成礼品的移动
Gift.prototype.move = function() {
	this.y += this.speed;
}
